load(
    "//bazel:tachyon_cc.bzl",
    "tachyon_cc_benchmark",
    "tachyon_cc_library",
    "tachyon_cc_unittest",
)

package(default_visibility = ["//visibility:public"])

tachyon_cc_library(
    name = "pippenger",
    hdrs = ["pippenger.h"],
    deps = [
        ":pippenger_base",
        "//tachyon/base:openmp_util",
        "//tachyon/base:profiler",
        "//tachyon/math/elliptic_curves:semigroups",
        "//tachyon/math/elliptic_curves/msm:msm_ctx",
        "//tachyon/math/elliptic_curves/msm:msm_util",
    ],
)

tachyon_cc_library(
    name = "pippenger_adapter",
    hdrs = ["pippenger_adapter.h"],
    deps = [
        ":pippenger",
        "//tachyon/base:parallelize",
        "//tachyon/base:profiler",
    ],
)

tachyon_cc_library(
    name = "pippenger_base",
    hdrs = ["pippenger_base.h"],
    deps = [
        "//tachyon/base:profiler",
        "//tachyon/base/containers:adapters",
        "//tachyon/math/base:semigroups",
        "//tachyon/math/geometry:affine_point",
        "//tachyon/math/geometry:point_xyzz",
        "@com_google_absl//absl/types:span",
    ],
)

tachyon_cc_unittest(
    name = "algorithms_unittests",
    srcs = [
        "pippenger_adapter_unittest.cc",
        "pippenger_unittest.cc",
    ],
    deps = [
        ":pippenger_adapter",
        "//tachyon/math/elliptic_curves/bls12/bls12_381:g1",
        "//tachyon/math/elliptic_curves/bn/bn254:g1",
        "//tachyon/math/elliptic_curves/msm/test:variable_base_msm_test_set",
    ],
)

tachyon_cc_benchmark(
    name = "pippenger_adapter_benchmark",
    srcs = ["pippenger_adapter_benchmark.cc"],
    deps = [
        ":pippenger_adapter",
        "//tachyon/base:logging",
        "//tachyon/math/elliptic_curves/bn/bn254:g1",
        "//tachyon/math/elliptic_curves/msm/test:variable_base_msm_test_set",
    ],
)

tachyon_cc_benchmark(
    name = "pippenger_benchmark",
    srcs = ["pippenger_benchmark.cc"],
    deps = [
        ":pippenger",
        "//tachyon/math/elliptic_curves/bn/bn254:g1",
        "//tachyon/math/elliptic_curves/msm/test:variable_base_msm_test_set",
    ],
)
